# 函数的额作用
# 1. 减少重复代码
# 2. 提高重用性

# 计算字符串的长度，不使用len方法
# num = 0
# a = "alex"
# for i in a:
#     num+=1
# print(num)

# 计算列表的长度，不使用len方法
# count = 0
# lst = [1,2,3,4,5,6]
# for i in lst:
#     count+=1
# print(count)

# 计算字典的长度，不使用len方法
# dic = {"key": 1, "a": "b"}
# k = 0
# for i in dic.keys():
#     k += 1
# print(k)

# v = 0
# for i in dic.values():
#     v += 1
# print(v)


# def 函数名():
#     函数体
# s = "alex"
# def my_len():
#     count = 0
#     for i in s:
#         count+=1
#     print(count)


# def my_len():
#     count = 0
#     for i in s:
#         count+=1
#     print(count)
# s = [1,2,3,4,5,6,23]
# # s= {"key": 1, "a": "b"}
# my_len()
# print("函数已经走过了")
# my_len()


# def my_len(other, count=0):
#     for i in other:
#         count += 1
#     return count

# s= my_len("alex")
# print(s)


# 调用函数
# 函数名+()
# 写函数实现功能，其实就是给功能加一个外壳
# 函数定义的时候，函数体中存放的是代码
# 只有函数被调用的时候函数体中的代码才会执行

# # 面向过程
# print(1)
# print(2)
# print(3)
# print(4)

# # 面向函数
# def my():
#     print(1)
# my()
# print(2)
# my()

# def my_len():
#     print("这是Python28期定制的求长度的函数")
#     count = 0
#     for i in s:
#         count += 1

# s = "alex"
# my_len()  # 再调用my_len函数

# 函数执行完，函数体中开辟的空间就自动销毁了
# 返回和显示是有大大的区别
# 返回的内容，还可以继续使用
# 显示了就不能进行使用了

# def my_len():
#     print("这是Python28期定制的求长度的函数")
#     count = 0
#     for i in s:
#         count += 1
#     return count


# s = "alex"
# c = my_len()
# print(c+10)

# def yue():
#     print("掏出手机")
#     print("打开微信")
#     print("打开附近的人")
#     print("聊一聊")
#     print("约一约")
#     return "乔碧罗","罗志祥","正压"

# print("我下班了")
# y= yue()
# print(y)

# s = "乔碧罗","罗志祥","正压"
# print(s)

# count = 0
# while count < 3:
#     username = input("请输入用户名")
#     userpassword = input("请输入密码")
#     with open(r'day05函数\info', 'r', encoding='utf-8') as f:
#         user, password = f.read().split(':')

#         if username == user and userpassword == password:
#             print("登陆成功")
#             break
#         else:

#             print("登录失败")
#     count += 1

# def logn():

#     with open(r'day05函数\info', 'r', encoding='utf-8') as f:
#         for i in range(3):
#             f.seek(0)
#             username = input("请输入用户名")
#             userpassword = input("请输入密码")
#             for i in f:
#                 user, password = i.strip().split(':')
#                 if username == user and userpassword == password:
#                     return "登陆成功"
#             else:
#                 print("登录失败")
#         # else:
#         #     print("登录失败")
#             # return "登录失败"


# result = logn()
# if result:
#     print(result)

# def func():
#     print('is func')


# ret = func()
# print(ret)

# lst = []
# print(lst.append(12))


# def func():
#     def foo():
#         pass
#         return foo
#     return 123
#     return b"123"


# ret = func()
# print(ret, type(ret))

# return 不写的时候默认返回None
# return 能够终止函数
# return 能够返回Python中的所有对象， Python中一切皆对象
# return 能够返回多个内容，以元组的形式显现
# return 下方代码不会被执行

# 函数的定义
# def 函数名():
#     函数体

# 函数的调用 函数名+()
# 1.调用函数
# 2. 接收返回值

# 函数的返回值 -- 保留有效数据
# return 值

# 账号，密码

from uuid import uuid4


user = input("user")
pwd = input("pwd")


def add_pwd():
    """
    加密
    :return：
    """
    import uuid
    return uuid4() #给密码进行加工，加工后是读不懂


def insert_pwd():
    ret = add_pwd() #ret是加工后的密码
    print(user,ret)

insert_pwd()

def check():
    pwd = add_pwd()
    if user == user and ret == pwd:
        return "login successfully"

# 参数